import { defineStore } from "pinia";

export const useStockStore = defineStore("stock", {
  // 也可以这样定义
  state: () => ({
    currSortStock: "", // 当前已经选择的股票分类
    currSortStock1: "", // 当前已经选择的股票分类
    currentIndex: undefined, // 市场页当前的索引
  }),
  actions: {
    addSortStock(val) {
      this.currSortStock = val;
      return val;
    },
    addSortStock1(val) {
      this.currSortStock1 = val;
      return val;
    },
    setCurrentIndex(val) {
      this.currentIndex = val;
    },
  },
});
